package bg.btanev.eightyfour.domain.entitybase;

import java.io.Serializable;

/**
 *
 * The {@link Persistable} {@link Domain} {@link Entity} base abstract implementation class. Used as a super class for
 * all domain {@link Entity} objects.
 *
 * @author B.Tanev
 *
 * @param <ID>
 *            the type of the unique identifier of the {@link DomainEntity}
 */
public abstract class DomainEntity<ID extends Serializable> implements Domain, Entity<ID> {
	/**
	 *
	 */
	private static final long serialVersionUID = -2468346844963905855L;

	/**
	 * Entity unique identifier place holder.
	 */
	private ID id;

	protected DomainEntity() {
		this(null);
	}

	protected DomainEntity(ID id) {
		super();
		setId(id);
	}

	@Override
	public ID getId() {
		return id;
	}

	protected void setId(ID id) {
		this.id = id;
	}

	@Override
	public String toString() {
		return "DomainEntity [id=" + id + "]";
	}
}
